package decoratorMod;

import java.util.ArrayList;

import decoratorMod.code.DecoratorTableA;
import decoratorMod.code.DecoratorTableB;
import decoratorMod.code.Table;

public class Client {
    public static void main(String[] args) {
        // 创建一个基本的表格对象
        code code = new code();
        ArrayList<String> list = new ArrayList<>();
        list.add("Basic Line 1");
        list.add("Basic Line 2");
        Table basicTable = code.new Table(list);

        // 使用 DecoratorTableA 装饰基本表格
        DecoratorTableA decoratedTableA = code.new DecoratorTableA(basicTable);
        System.out.println("Table decorated with A:");
        decoratedTableA.printTable();

        // 使用 DecoratorTableB 装饰基本表格
        DecoratorTableB decoratedTableB = code.new DecoratorTableB(basicTable);
        System.out.println("\nTable decorated with B:");
        decoratedTableB.printTable();
    }
}
